#ifndef ADDFRIENDDIALOG_H
#define ADDFRIENDDIALOG_H

#include <QDialog>
#include <QLineEdit>
#include <QScrollBar>
#include <QVBoxLayout>
#include <QWidget>
#include<QScrollArea>
#include <QLabel>

class AddFriendScrollArea;
class AddFriendScrollItem:public QWidget
{
    Q_OBJECT
public:
    AddFriendScrollItem(AddFriendScrollArea*owner,const QIcon&avator,const QString&name,const QString&signature, QWidget*parent=nullptr);
private:
    AddFriendScrollArea*owner;
    QHBoxLayout *layout;

    QPushButton*avator;

    QLabel*nameLabel;
    QLabel*signature;
    QVBoxLayout*nameSignallayout;

    QPushButton*addFriendBtn;

};

class AddFriendScrollArea:public QScrollArea
{
    Q_OBJECT
public:
    AddFriendScrollArea(QWidget*parent=nullptr);
    void addItem(const QIcon &avator, const QString &name, const QString &signature);
private:
    QWidget *contain;
    QVBoxLayout*layout;
};

class AddFriendDialog : public QDialog
{
    Q_OBJECT
public:
    AddFriendDialog(QWidget*parent=nullptr);
    QVBoxLayout*layout;

    QHBoxLayout*searchlayout;
    QLineEdit*searchline;
    QPushButton*searchbtn;
    AddFriendScrollArea*scroolArea;
};

#endif // ADDFRIENDDIALOG_H
